package com.unitreport.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.unitreport.service.SvnServiceI;

/**
 * 
 * @author Yu Yang
 *
 * 2013年9月26日
 */
@Controller
@RequestMapping("svnController")
public class SvnController {
	
	private SvnServiceI svnService;

	@RequestMapping("getSvnRepositoriesDir")
	public @ResponseBody
	Object getSvnRepositoriesDir(String id) {
		System.out.println(id);
		
		if(id == null) {
			return svnService.getRootUrl();
		} else {
			return svnService.getChildren(id);
		}
		
		
	}

	@Resource(name="svnService")
	public void setSvnService(SvnServiceI svnService) {
		this.svnService = svnService;
	}
}
